package com.chuzhiyun.chengguoxy.network;
import com.lzy.okgo.model.Response;

@SuppressWarnings("ThrowableNotThrown")
public abstract class StringNetCallback implements INetCallback<String> {
    @Override
    public String convertResponse(Object response) throws Throwable{
        String body = ((Response<String>) response).body();
        if (body instanceof String) {
            String data =body;
            return data;
        } else {
            new Exception("response 类型错误，该回调只能使用String 类型");
        }
        return null;
    }
}